<template>
  <div class="component">
    <van-nav-bar
      :title="title"
      left-text=""
      :left-arrow='isBack'
      @click-left="onClickLeft"
      :border='border'
    />
  </div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
// 接受父组件传递的参数
const props = defineProps({
  title: {
    type: String,
    default: "",
  },
  isBack: {
    type: Boolean,
    default: false,
  },
  border: {
    type: Boolean,
    default: true,
  },
});
const router = useRouter();
 const onClickLeft = () => router.back();
onMounted(() => {});
</script>
<style scoped lang="less">
.component {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 999;
}
</style>
